#include "GameEngine.h"

#include <string>

using namespace std;

GameEngine::GameEngine()
{
	_moduleList = new std::list<Module *>();
}

GameEngine::~GameEngine()
{
}

std::string const * GameEngine::getClassName(){
	return new std::string("GameEngine");
}

void GameEngine::initialize(){
}

void GameEngine::start(){
}

void GameEngine::restart(){
}

void GameEngine::pause(){
}

void GameEngine::resume(){
}

void GameEngine::stop(){
}

void GameEngine::shutdown(){
}

void GameEngine::addModule(Module * module){
	_moduleList->push_back(module);
}

void GameEngine::removeModule(int key){
	std::list<Module *>::iterator it;
	for(it = _moduleList->begin(); it != _moduleList->end(); ++it)
		if( (*it)->getKey() == key ){
			_moduleList->erase(it);
			return;
		}
}

Module * GameEngine::getModule(int key){
	std::list<Module *>::iterator it;
	for(it = _moduleList->begin(); it != _moduleList->end(); ++it)
		if( (*it)->getKey() == key )
			return (*it);
	return 0;
}
